package model.commands.booleans;

import java.util.List;
import model.Environment;
import model.SyntaxErrorException;
import model.commands.Command;


/**
 * Name:
 * LESS? value1 value2
 * LESSP value1 value2
 * 
 * Description:
 * returns 1 if value1 is strictly less than value2, otherwise 0
 * 
 * @author JLongley
 * @author Erick Gonzalez
 */
public class LessThanCommand extends Command {
    
    @Override
    public int evaluate(Environment e) throws SyntaxErrorException {
        List<Command> myArguments = getArguments();
        Command arg1 = myArguments.get(0);
        Command arg2 = myArguments.get(1);
        return arg1.evaluate(e) < arg2.evaluate(e) ? 1 : 0;
    }
}
